<template>
	<view>
		<scroll-view scroll-y class="page">
			<view class="nav-list margin-top">
				<navigator hover-class="none" :url="'./detail?name=' + item.title" class="nav-li" navigateTo :class="'bg-'+item.color"
				 :style="[{animation: 'show ' + ((index+1)*0.2+1) + 's 1'}]" v-for="(item,index) in elements" :key="index">
					<view class="nav-title">{{item.title}}</view>
					<view class="nav-name">{{item.name}}</view>
					<text :class="'cuIcon-' + item.cuIcon"></text>
				</navigator>
			</view>
			<view class="cu-tabbar-height"></view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			name:'shopQrcode'
			return {
				seletedMoudelId:0,
				elements: [{
						title: '品牌介绍',
						name: 'brand',
						color: 'cyan',
						cuIcon: 'newsfill'
					},
					{
						title: '时光喷雾',
						name: 'time mist',
						color: 'blue',
						cuIcon: 'colorlens'
					},
					{
						title: '零添加',
						name: 'natural',
						color: 'purple',
						cuIcon: 'font'
					},
					{
						title: '商业模式',
						name: 'model',
						color: 'mauve',
						cuIcon: 'cuIcon'
					},
					{
						title: '售后服务',
						name: 'after sale',
						color: 'pink',
						cuIcon: 'btn'
					},
					{
						title: '科学护肤',
						name: 'skin care',
						color: 'brown',
						cuIcon: 'tagfill'
					}
				]
			}
		},
		onLoad(e) {
			if(e.shareUser){
				let shop = uni.getStorageSync('shop') || {}
				shop.shareU = e.shareUser
				uni.setStorageSync('shop',shop)
				uni.setStorageSync('shareUser',{'shareU':e.shareUser})
			}
			if(e.shop_name){
				let shop = uni.getStorageSync('shop') || {}
				shop.shop_name = e.shop_name
				uni.setStorageSync('shop',shop)
			}
			if(e.phone){
				uni.setStorageSync('referrer', e.phone)
			}
		},
		methods: {
			onShareAppMessage() {
				let role_id = uni.getStorageSync('role').id
				let user = uni.getStorageSync('userInfo').nickname
				let phone = uni.getStorageSync('userInfo').mobile
				let shop_name = uni.getStorageSync('shop').shop_name
				let title = ''
				let path = ''
				if(role_id){
					title = user +'的' +shop_name+',快进来看看吧'
					path = 'pages/introduce/index?shareUser='+user+'&shop_name='+shop_name+'&phone='+phone
				}else{
					title = shop_name+'欢迎您的光临'
					path = 'pages/introduce/index'
				}
			    return {
					title: title,
					path: path
			    }
			},
			handleMoudel(index){
				this.seletedMoudelId = index
			},
			handleShare(){
				uni.showToast({
					success: () => {
						Text:'合成中。。。'
					}
				})
				let selectMoudel = this.moudleList[this.seletedMoudelId]
				// console.log('selectMoudel',selectMoudel)
			}
		}
	}
</script>

<style lang="scss" scoped>
.introduceList{
	width: 100%;
	height: 100%;
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	.introduceitem{
		width: 42%;
		height: 450rpx;
	}
}
.page {
		height: 100vh;
	}
</style>
